﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using NPMonitor.Attributes;

namespace NPMonitor.DataModel
{
    [Serializable]
    [Table("Scenarios")]
    public class Scenario
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int? Id { get; set; }

        [Required]
        public int? JobId { get; set; }

        public string ScenarioNO { get; set; }

        public int? BaseTime { get; set; }

        public string ScenarioName { get; set; }

        public string URL { get; set; }

        public bool? Enabled { get; set; }

        [Column("Desc")]
        public string Description { get; set; }

        public JobDefinition Job { get; set; }

        public Scenario()
        {
            Enabled = true;
        }

        public Scenario(ScenarioAttribute scenarioAttribute)
            : this()
        {
            this.ScenarioNO = scenarioAttribute.ScenarioNO;
            this.ScenarioName = scenarioAttribute.ScenarioName;
            this.BaseTime = scenarioAttribute.BaseTime;
            this.URL = scenarioAttribute.URL;
            this.Description = scenarioAttribute.Description;
        }
    }
}
